reference_categories <- c(
	"not_married",
	"illiterate",
	"luganda_lang",
	"muganda_tribe",
	"no_work",
	"christian_only",
	"all_boys",
	"all_girls",
	"more_boys_than_girls",
	"more_girls_than_boys",
	"roughly_equal",
	"idntcraslngasonisaby",
	"idntcraslngasonisagr",
	"it_doesnt_matter",
	"not_married_ml",
	"illiterate_ml",
	"luganda_lang_ml",
	"muganda_tribe_ml",
	"no_work_ml",
	"christian_only_ml",
	"block_1"
)


if(rerun_lasso){
	
	# Set seed ----------------------------------------------------------------
	
	set.seed(1234567)
	

# Lab experiment ----------------------------------------------------------

	lasso_covariates <- lab_covariates
	
	ABS_covariates_lab <- lapply(
		FUN = run_lasso_get_variables,
		X = c(abs_outcomes_lab, "absenteeism_action"),
		covariates = lasso_covariates,
		data = lab,
		N_folds = 10,
		sims = 10
	)
	
	names(ABS_covariates_lab) <- c(abs_outcomes_lab,  "absenteeism_action")
	
	ABS_covariates_lab <- sapply(names(ABS_covariates_lab), prep_covariates, 
															 lasso_list = ABS_covariates_lab, 
															 USE.NAMES = TRUE)
	


# Field experiment --------------------------------------------------------
	
	# ABS variables-------------------------------------------------------
	
	# Do for compliers using complier data 
	cluster_level_covariates <- paste0(c(covariates_only_vhts, covariates_all_healthworkers), "_ml")
	
	lasso_covariates <- notin(c(covariates_ml,cluster_level_covariates, block_vars, "resample"),reference_categories)
	
	ABS_lasso_covariates_panel <- lapply(
		FUN = run_lasso_get_variables,
		X = c(absenteeism_outcomes_el, absenteeism_outcomes_ml, "absenteeism_action_ml","absenteeism_action", "absenteeism_action_total"),
		covariates = lasso_covariates,
		data = el[el$respondent_category == "Complier",],
		N_folds = 10,
		sims = 10
	)
	
	names(ABS_lasso_covariates_panel) <- c(absenteeism_outcomes_el,absenteeism_outcomes_ml, "absenteeism_action_ml","absenteeism_action", "absenteeism_action_total")
	
	ABS_lasso_covariates_panel <- sapply(names(ABS_lasso_covariates_panel), 
																			 prep_covariates, 
																			 lasso_list = ABS_lasso_covariates_panel,
																			 USE.NAMES = TRUE)
	


	save(ABS_lasso_covariates_panel,ABS_covariates_lab, file = "01_data/lasso_covariates/lasso_selected_covariates.Rdata")
	
} else{
	
	load("01_data/lasso_covariates/lasso_selected_covariates.Rdata")
	
}

